#ifndef __WAITERLIST_H__
#define __WAITERLIST_H__

#include "comdef.h"
#include "MyEvent.h"
#include "Lock.h"

#include <string>
#include <deque>
using namespace std;

#define MAX_TIMEOUT_LEN		10

typedef struct  tagRspInfo
{
	int			nLen;
	char		*pData;
	tagRspInfo()
	{
		pData = NULL;
		nLen = 0; 
	}
}RspInfo, *LPRspInfo;

typedef string KeyType;
typedef unsigned long ParamType;

class CWaiterListImpl;
class DLL_EXT_CLASS CWaiterList
{
public:
	CWaiterList();
	~CWaiterList();

	int AddWaitItem(const KeyType &key);
	bool Wait(int nIndex, int nTimeout, ParamType &param);
	bool Signal(const KeyType &key, const ParamType &param);

private:
	CWaiterListImpl		*m_pImpl;
};

#endif
